﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace HengTong.DataAccess.Migrations
{
    /// <inheritdoc />
    public partial class 招聘需求池关表联错误修改 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_SysHrRecruitPool_SysHrRecruitRequestBillEntry_RecruitRequestBillEntryID",
                table: "SysHrRecruitPool");

            migrationBuilder.DropColumn(
                name: "RecruitSubId",
                table: "SysHrRecruitPool");

            migrationBuilder.RenameColumn(
                name: "RecruitRequestBillEntryID",
                table: "SysHrRecruitPool",
                newName: "RecruitRequestBillEntryId");

            migrationBuilder.RenameIndex(
                name: "IX_SysHrRecruitPool_RecruitRequestBillEntryID",
                table: "SysHrRecruitPool",
                newName: "IX_SysHrRecruitPool_RecruitRequestBillEntryId");

            migrationBuilder.AddForeignKey(
                name: "FK_SysHrRecruitPool_SysHrRecruitRequestBillEntry_RecruitRequestBillEntryId",
                table: "SysHrRecruitPool",
                column: "RecruitRequestBillEntryId",
                principalTable: "SysHrRecruitRequestBillEntry",
                principalColumn: "ID");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_SysHrRecruitPool_SysHrRecruitRequestBillEntry_RecruitRequestBillEntryId",
                table: "SysHrRecruitPool");

            migrationBuilder.RenameColumn(
                name: "RecruitRequestBillEntryId",
                table: "SysHrRecruitPool",
                newName: "RecruitRequestBillEntryID");

            migrationBuilder.RenameIndex(
                name: "IX_SysHrRecruitPool_RecruitRequestBillEntryId",
                table: "SysHrRecruitPool",
                newName: "IX_SysHrRecruitPool_RecruitRequestBillEntryID");

            migrationBuilder.AddColumn<Guid>(
                name: "RecruitSubId",
                table: "SysHrRecruitPool",
                type: "uniqueidentifier",
                nullable: true);

            migrationBuilder.AddForeignKey(
                name: "FK_SysHrRecruitPool_SysHrRecruitRequestBillEntry_RecruitRequestBillEntryID",
                table: "SysHrRecruitPool",
                column: "RecruitRequestBillEntryID",
                principalTable: "SysHrRecruitRequestBillEntry",
                principalColumn: "ID");
        }
    }
}
